
export default class AndroidTool {

	public static _instance:AndroidTool = null
    public static get Instance(){
        if (null == this._instance) {
            this._instance = new AndroidTool();
        }
        return this._instance
    }

	className="com/sheep/game/GameBridge" 

	loadVideoAd(location:string){
		let methodName="loadVideoAd"
		let methodSignature = "(Ljava/lang/String;)V";

		jsb.reflection.callStaticMethod(this.className, methodName, methodSignature, location);
	}

    loadFinish(){
		let methodName="loadFinish"
		let methodSignature = "()V";

		jsb.reflection.callStaticMethod(this.className, methodName, methodSignature);
	}

    onGoHome(){
        let methodName="onGoHome"
		let methodSignature = "()V";

		jsb.reflection.callStaticMethod(this.className, methodName, methodSignature);
    }

    onStartGame(){
        let methodName="onStartGame"
		let methodSignature = "()V";

		jsb.reflection.callStaticMethod(this.className, methodName, methodSignature);
    }

    onLevel(level){
        let methodName="onLevel"
		let methodSignature = "(I)V";

		jsb.reflection.callStaticMethod(this.className, methodName, methodSignature,level);
    }

	onShare(){
		let methodName="onShare"
		let methodSignature = "()V";

		jsb.reflection.callStaticMethod(this.className, methodName, methodSignature);
	}

	onPauseViewShow(){
		let methodName="onPauseViewShow"
		let methodSignature = "()V";

		jsb.reflection.callStaticMethod(this.className, methodName, methodSignature);
	}

	onPauseViewHide(){
		let methodName="onPauseViewHide"
		let methodSignature = "()V";

		jsb.reflection.callStaticMethod(this.className, methodName, methodSignature);
	}

	onWinViewShow(){
		let methodName="onWinViewShow"
		let methodSignature = "()V";

		jsb.reflection.callStaticMethod(this.className, methodName, methodSignature);
	}

	onWinViewHide(){
		let methodName="onWinViewHide"
		let methodSignature = "()V";

		jsb.reflection.callStaticMethod(this.className, methodName, methodSignature);
	}

	onLoseViewShow(){
		let methodName="onLoseViewShow"
		let methodSignature = "()V";

		jsb.reflection.callStaticMethod(this.className, methodName, methodSignature);
	}

	onLoseViewHide(){
		let methodName="onLoseViewHide"
		let methodSignature = "()V";

		jsb.reflection.callStaticMethod(this.className, methodName, methodSignature);
	}

	onNextLevel(){
		let methodName="onNextLevel"
		let methodSignature = "()V";

		jsb.reflection.callStaticMethod(this.className, methodName, methodSignature);
	}

	isAndroid(){
		return cc.sys.platform==cc.sys.ANDROID
	}
	
}